# -*- coding: utf-8 -*-
import time
import pandas as pd
import geopandas as gpd
from statsmodels.stats.outliers_influence import variance_inflation_factor
from statsmodels.tools.tools import add_constant
from gwlsa_settings import net_params

start_time = time.time()

data = gpd.read_file(net_params['raw_data_path'], layer=net_params['layer_name'], encoding=net_params['csv_encoding'])
y_labelname = net_params['y_column_name']
x_column = net_params['x_column_names']
remove_columns=[]

for rm in remove_columns:
    x_column.remove(rm)
print(len(x_column))
y_column = [y_labelname]

y = data[y_column]
X = data[x_column]

X = add_constant(X)
vif_ss = pd.Series([variance_inflation_factor(X.values, i)
               for i in range(X.shape[1])],
              index=X.columns)
print(vif_ss)
